# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Vision.V1.Model.ProductSet do
  @moduledoc """
  A ProductSet contains Products. A ProductSet can contain a maximum of 1 million reference images. If the limit is exceeded, periodic indexing will fail.

  ## Attributes

  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The user-provided name for this ProductSet. Must not be empty. Must be at most 4096 characters long.
  *   `indexError` (*type:* `GoogleApi.Vision.V1.Model.Status.t`, *default:* `nil`) - Output only. If there was an error with indexing the product set, the field is populated. This field is ignored when creating a ProductSet.
  *   `indexTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which this ProductSet was last indexed. Query results will reflect all updates before this time. If this ProductSet has never been indexed, this timestamp is the default value "1970-01-01T00:00:00Z". This field is ignored when creating a ProductSet.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The resource name of the ProductSet. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. This field is ignored when creating a ProductSet.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :displayName => String.t() | nil,
          :indexError => GoogleApi.Vision.V1.Model.Status.t() | nil,
          :indexTime => DateTime.t() | nil,
          :name => String.t() | nil
        }

  field(:displayName)
  field(:indexError, as: GoogleApi.Vision.V1.Model.Status)
  field(:indexTime, as: DateTime)
  field(:name)
end

defimpl Poison.Decoder, for: GoogleApi.Vision.V1.Model.ProductSet do
  def decode(value, options) do
    GoogleApi.Vision.V1.Model.ProductSet.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Vision.V1.Model.ProductSet do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
